<script>
    $(function () {
        PageAction.currentPageActionClassName = '<?= $_GET['currentPageActionClassName'] ?>';
        PageAction.currentPageAction = '<?= ucfirst($_GET['action']) ?>';

        if (typeof PageAction[PageAction.currentPageActionClassName].doContentAction == 'undefined') {
            PageAction[PageAction.currentPageActionClassName].doContentAction = function () {
                var _test = Tools.checkNull('mobile', '请输入手机号');
                var action = '<?= App\Admin\Helper::getActionName($_GET['action']) ?>';
                if (_test) {
                    if (action == '添加' && ($('#remarks').val() == '')) {
                        Tools.checkNull('remarks', '请输入备注');
                        return false;
                    }
                    $.dialog.locking('系统已启动，请稍候。。。');

                    var _this = this;
                    $.post(this.handlerUrl + PageAction.currentPageAction,
                        Tools.addEditPageLoader().DOM.form.serializeArray(),
                        function (data) {
                            switch (data.status) {
                                case 'SUCCESS' :
                                    $(_this.grid).dataGridReload();


                                    $.dialog.locking.alert('success', '编辑成功', function () {
                                        Tools.addEditPageLoader().close();
                                        return true;
                                    });

                                    break;
                                case 'NO_CHANGES' :
                                    $.dialog.locking.alert('ndash', data.desc);
                                    break;
                                case 'DB_ERROR' :
                                case 'INTERCEPTOR' :
                                case 'USER_IS_EXISTS' :
                                    $.dialog.locking.alert('error', data.desc);
                                    break;
                                default :
                                    $.dialog.locking.alert('error', '系统繁忙，请稍候再试');
                                    break;
                            }
                        }, 'json');
                }
            };
        }

        Tools.addEditPageLoader()
            .title('<?= $this->adminMap[$this->security]['title'] ?> » <?= $this->adminMap[$this->security]['menu'][$_GET['parentPageId']]['name'] ?> » <?= App\Admin\Helper::getActionName($_GET['action']) ?>');

        <?php
        if ($this->pageControl) {
        ?>
        Tools.addEditPageLoader().button({
            id: 'ok',
            name: Tools.addEditPageLoader().config.okVal,
            callback: function () {

                PageAction[PageAction.currentPageActionClassName]
                    .doContentAction
                    .call(PageAction[PageAction.currentPageActionClassName]);

                return false;
            },
            unshift: true,
            type: 'submit',
            focus: true
        });
        <?php
        }
        ?>
    });
    Tools.switchDiv('.switch > ul > li', 'slt_switch', '.switch_list');
</script>

<input type="hidden" name="id" id="id" value="<?= $_GET['id'] ?>">
<div class="switch">
    <ul>
        <li class="slt_switch">基本信息</li>
<!--        <li>个人信息</li>-->
    </ul>
    <div class="switch_list">
        <table width="100%" cellpadding="0" cellspacing="0" class="data_input">
            <tr>
                <th width="15%">手机</th>
                <td width="35%"><?= App\Tools\Html::text($this->pageControl, 'mobile', $this->rs) ?></td>
                <th width="15%">用户名</th>
                <td width="35%"><?= App\Tools\Html::text($this->pageControl, 'member_name', $this->rs) ?></td>
            </tr>
            <tr>
                <th>性别</th>
                <td><?= App\Tools\Html::radio($this->pageControl, 'sex', $this->rs, $this->setting['arySex']) ?></td>
                <th>所属科室</th>
                <td><?= App\Tools\Html::radio($this->pageControl, 'department_id', $this->rs, $this->setting['aryMemberType']) ?></td>
            </tr>
            <tr>
                <th>常住区域</th>
                <td><?= App\Tools\Html::text($this->pageControl, 'location', $this->rs) ?></td>
                <th></th>
                <td></td>
            </tr>
            <tr>
                <th>会员状态</th>
                <td><?= App\Tools\Html::radio($this->pageControl, 'is_status', $this->rs, $this->setting['aryMemberStatus']) ?></td>
                <th>密码修改</th>
                <td><?= App\Tools\Html::text($this->pageControl, 'password', null, '', '', '', '不修改则不填') ?></td>
            </tr>
            <tr>
                <th>备注</th>
                <td><?= App\Tools\Html::textarea($this->pageControl, 'remarks', $this->rs, '', '5') ?></td>
                <th></th>
                <td></td>
            </tr>
            <tr>
                <th>注册时间</th>
                <td><?= App\Tools\Auxi::getTime($this->rs->add_date) ?></td>
                <th>最后登录时间</th>
                <td><?= App\Tools\Auxi::getTime($this->rs->last_log_date) ?></td>
            </tr>
        </table>
    </div>
</div>
